/**
 * 推荐码管理页面管理页面js
 * 版权所有：上海戈品投资管理有限公司
 *   author king
     功能说明：推荐码管理
     创建日期：2015-10-12
     修改记录：
     备注说明：
 */

$(document).ready(function() {
	showLogList();
	 $(".date").datepicker({
	        todayBtn: "linked",
	        keyboardNavigation: false,
	        forceParse: false,
	        calendarWeeks: true,
	        autoclose: true
	    });
});

/**
 * 查询充值记录
 * @returns
 */
var showLogList = function(){
	
	var projectName=$("#projectName").val();
	var operateTime=$("#operateTime").val();
	
	var datas =  {"p":"merchantManage","m":"queryfillInLog","projectName":projectName,"operateTime":operateTime};
	var columnDefine = {"id":"主键","projectId":"项目ID","projectName":"项目名称","operateTime":"充值时间","operator":"操作人","remark":"备注"};
	
	var formatters={
	            "operateTime": function (column, row)
	            {
    				return timeFormatTrans(row.operateTime);
	            },
	 };
	 var buttons =''; //操作按钮
		buttons+='<p>';
		//buttons+='<button type=\'button\' class=\'btn btn-w-m btn-info\' onclick="showNewRemarkWin();">添加备注</button>';
		buttons+='</p>';
	   hui.pager('service',datas ,"dataList", columnDefine , formatters , buttons ); //分页查询
};

var getTheSureTime=function(emp){
	return emp>9?emp:"0"+emp;
}
//时间格式转换
var timeFormatTrans=function(time){
	var newTime= new Date(time);
	var rowText=newTime.getFullYear()+'-'+getTheSureTime((newTime.getMonth()+1))+'-'
	+getTheSureTime(newTime.getDate())+' '+getTheSureTime(newTime.getHours())+':'
	+getTheSureTime(newTime.getMinutes())+':'+getTheSureTime(newTime.getSeconds());
	return rowText;
};


